package com.payment.ktb.utils;

import com.payment.ktb.model.City;

import java.util.Comparator;

/**
 * Created by syd on 2016/7/28.
 */
public class PinyinComparator implements Comparator<City> {

    @Override
    public int compare(City lhs, City rhs) {
        if (lhs.getSymbol().equals("@")
                || rhs.getSymbol().equals("#")) {
            return -1;
        } else if (lhs.getSymbol().equals("#")
                || rhs.getSymbol().equals("@")) {
            return 1;
        } else {
            return lhs.getSymbol().compareTo(rhs.getSymbol());
        }
    }
}
